//
//  XQEmergencyCell.swift
//  Spark Peso
//
//  Created by 小琦 on 2025/2/11.
//

import UIKit

class XQEmergencyCell: UITableViewCell {
    
    public lazy var phoneView : XQEmergencyView = {
        let view = XQEmergencyView()
        view.isPhone = true
        return view
    }()
    
    public lazy var contactView : XQEmergencyView = {
        let view = XQEmergencyView()
        view.isPhone = false
        return view
    }()
    
    override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
       super.init(style: style, reuseIdentifier: reuseIdentifier)
        self.selectionStyle = .none
        makeUI()
        makeConstraints()
    }

    required init?(coder: NSCoder) {
       fatalError("init(coder:) has not been implemented")
    }

    
    private func makeUI() {
        self.contentView.addSubview(self.phoneView)
        self.contentView.addSubview(self.contactView)
    }
    
    private func makeConstraints() {
        self.phoneView.snp.makeConstraints { make in
            make.top.equalTo(0)
            make.left.right.equalTo(0)
            make.height.equalTo(78)
        }
        self.contactView.snp.makeConstraints { make in
            make.top.equalTo(self.phoneView.snp.bottom).offset(20)
            make.left.right.equalTo(0)
            make.height.equalTo(78)
        }
    }
}
